package org.winexpress

class ShoppingCart {
    
    int id
    Date creationDate
    Date modifiedDate
    String uniqueKey  // unique cart key generated for visitor (but members also can use)
    
    static hasOne = [customer:Customer]
    static hasMany = [cartItems:CartItem]
    
//    static mapping = {
//        key type: 'text'
//    }

    static constraints = {
        id(blank:false, unique:true)
        creationDate(blank:true)
        modifiedDate(blank:true)
        customer(blank:true, nullable:true)
        uniqueKey(blank:true, nullable:true)
    }
}
